go to previous page   go to home page   go to next page

Answer:

See the buttons.


Size of the Frame

wide frame

The layout manager for this GUI is FlowLayout, which means that the components are placed in the frame left to right starting at the top row. As many components as can fit go into the first row, even if this means separating a label from its button.

To get the GUI to look right, the width and height have to be set correctly.

fatApp.setSize( 280, 200 );     

This is a matter of trial-and-error. Better ways to do this using additional features of Swing are discussed in the following chapters. Another useful thing to do is to give the entire frame a title. This is done with:

setTitle( String title )

Now the top bar of the frame (the one that contains the "close icon") has this title. In previous examples this was done by calling the superclass constructor with the title string.


QUESTION 16:

Suggest a good title for the frame.